// 接口地址: https://wwww.xxxx.com
const origin = '';
// 项目构建部署路径(注意在最后携带斜线)：/xxxx/
const deployDirectory = '/xiaoMing-bms/';
// 项目全路径
const href = `${origin}${deployDirectory === '/' ? '' : deployDirectory}`;
// api前缀
const apiPrefix = `${href}api`;
// 下载路径
// const downloadApi = `${href}file/download`;
const downloadApi = `/xiaoMing-file/api/file/file/download`;

// /xiaoMing-file/api/file/file/download
// 上传路径
// const uploadApi = `/xiaoMing-file/api/file/file/upload`;
const uploadApi = `/xiaoMing-file/api/file/file/upload`;
// im
const socketApi = `${href}im`;
// 客户端标识
const client = '00';
// 全局配置
let configure = {
  origin,
  deployDirectory,
  href,
  apiPrefix,
  downloadApi,
  uploadApi,
  socketApi,
  client,
  api: {},
};
// 初始化配置变量
export const initConfigure = (obj) => {
  configure = { ...configure, ...obj };
  return configure;
};
// 取出配置变量
export const getConfigure = () => {
  return configure;
};

export default {
  init: initConfigure,
};
